<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLogEmailsTable extends Migration
{
    /**邮件日志表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('log_emails', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('server_id')->comment('游戏服id');
            $table->tinyInteger('recipient_type')->comment('收件人类型1:所有,0指定');
            $table->string('recipients')->nullable()->comment('收件人');
            $table->string('title', 100)->comment('标题');
            $table->text('content')->comment('邮件内容');
            $table->string('level_section', 50)->nullable()->comment('等级区间');
            $table->tinyInteger('status')->default(0)->comment('1已发送,0待发送');
            $table->timestamp('send_at')->nullable()->comment('发送时间');
            $table->string('admin_name')->comment('发件人');
            $table->tinyInteger('add_type')->comment('0内部添加,1外部api添加');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_emails');
    }
}
